<?php
	require '../biz/backend.php';

	class action extends backend
	{
		var $get_privilege_id = '87';

		function do_get()
		{
			$template = load( 'template', array( 'domain'=>'tpl.admin' ) );

			//模板类型
			$argument = load( 'biz.argument' );
			$template->assign( 'tpl_type_cname', $argument->tpl_type_cname );

			//栏目名称
			$cate = load( 'biz.cate' );
			$cata_data = $cate->all( array( 'size' => 99999 ) );
			$template->assign( 'cate_data', $cate->x_to_y( $cata_data['data'], 'id', 'cname' ));

			$tpl = load( 'biz.tpl' );
			$result = $tpl->all( $this->input );

			if ( $result['page'] > 1 )
			{
				$navigation = load( 'navigation' );
				$template->assign( 'bar', $navigation->compute( $result['total'], $result['size'] ) );
			}

			$template->assign( 'data', $result['data'] );
			$template->assign( 'current_url', config( 'current_url' ) );
			$template->assign( 'reference', isset( $this->input['reference'] ) ? urldecode( $this->input['reference'] ) : config( 'server.HTTP_REFERER' ) );
			echo $template->parse( 'list_tpl.php' );
		}

	}

	$action = new action();
	$action->run();
?>